package com.epfresh.supplier.entity;


import com.epfresh.api.utils.JsonUtils;

public class Auth {
    /*
           {
          "id": 4,
          "sale": false,
          "purchase": false,
          "process": false,
          "distribution": false,
          "warehouse": false,
          "pickupByCustomer": false,
          "deliveryForOthers": false,
          "splitOrder": false,
          "priceMode": 1,
          "priceGroupType": 1,
          "needBind": false,
          "storeCategoryType": 1,
          "saleChannelApp": false,
          "saleChannelPos": false,
          "beginTime": null,
          "endTime": null,
          "merchantId": 18
        }
    * */
//    private boolean process;
//    private boolean deliveryForOthers;
//    private int needBind;
//    private int priceMode;
//    //"1",非分组,"2",分组
//    private String priceGroupType;
//    private boolean purchase;
//    private boolean splitOrder;
//    private int storeCategoryType;
//    private boolean pickupByCustomer;
//    private boolean saleChannelApp;
//    private boolean distribution;
//    private boolean warehouse;
//    private boolean sale;
//    private String merchantId;
//    private boolean saleChannelPos;
//    private int id;
//    private Object beginTime;
//    private Object endTime;

    /*"auth": {
        "id": 18,
                "sale": true, //销售管理权限
                "purchase": false,//采购管理权限
                "process": false,//分拣加工权限
                "distribution": false,//送货管理权限
                "warehouse": false,//仓储管理权限
                "pickupByCustomer": false,//到店自提
                "deliveryForOthers": false,//集单配送
                "splitOrder": false,//独立订单
                "needBind": false,//是否需要绑定
                "storeCategoryType": 1,//店内分类类型（1、一级，2、二级）
                "beginTime": null,//开始授权时间
                "endTime": null,//结束授权时间
                "merchantId": 255//商户ID
    }*/

    private boolean process;
    private boolean deliveryForOthers;
    private boolean needBind;
    private String priceMode;
    //"1",非分组,"2",分组
    private String priceGroupType;
    private boolean purchase;
    private boolean splitOrder;
    //"1",一级;"2","2",二级
    private String storeCategoryType;
    private boolean pickupByCustomer;
    private boolean saleChannelApp;
    private boolean distribution;
    private boolean warehouse;
    private boolean sale;
    private String merchantId;
    private boolean saleChannelPos;
    private String id;
    private Object beginTime;
    private Object endTime;

    private boolean iBuy;
    private boolean iSell;

    public boolean isiBuy() {
        return iBuy;
    }

    public void setiBuy(boolean iBuy) {
        this.iBuy = iBuy;
    }

    public boolean isiSell() {
        return iSell;
    }

    public void setiSell(boolean iSell) {
        this.iSell = iSell;
    }

    public boolean isProcess() {
        return process;
    }

    public void setProcess(boolean process) {
        this.process = process;
    }

    public boolean isDeliveryForOthers() {
        return deliveryForOthers;
    }

    public void setDeliveryForOthers(boolean deliveryForOthers) {
        this.deliveryForOthers = deliveryForOthers;
    }

    public boolean isNeedBind() {
        return needBind;
    }

    public void setNeedBind(boolean needBind) {
        this.needBind = needBind;
    }

    public String getPriceMode() {
        return priceMode;
    }

    public void setPriceMode(String priceMode) {
        this.priceMode = priceMode;
    }

    public String getPriceGroupType() {
        return priceGroupType;
    }

    public void setPriceGroupType(String priceGroupType) {
        this.priceGroupType = priceGroupType;
    }

    public boolean isPurchase() {
        return purchase;
    }

    public void setPurchase(boolean purchase) {
        this.purchase = purchase;
    }

    public boolean isSplitOrder() {
        return splitOrder;
    }

    public void setSplitOrder(boolean splitOrder) {
        this.splitOrder = splitOrder;
    }

    public String getStoreCategoryType() {
        return storeCategoryType;
    }

    public void setStoreCategoryType(String storeCategoryType) {
        this.storeCategoryType = storeCategoryType;
    }

    public boolean isPickupByCustomer() {
        return pickupByCustomer;
    }

    public void setPickupByCustomer(boolean pickupByCustomer) {
        this.pickupByCustomer = pickupByCustomer;
    }

    public boolean isSaleChannelApp() {
        return saleChannelApp;
    }

    public void setSaleChannelApp(boolean saleChannelApp) {
        this.saleChannelApp = saleChannelApp;
    }

    public boolean isDistribution() {
        return distribution;
    }

    public void setDistribution(boolean distribution) {
        this.distribution = distribution;
    }

    public boolean isWarehouse() {
        return warehouse;
    }

    public void setWarehouse(boolean warehouse) {
        this.warehouse = warehouse;
    }

    public boolean isSale() {
        return sale;
    }

    public void setSale(boolean sale) {
        this.sale = sale;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public boolean isSaleChannelPos() {
        return saleChannelPos;
    }

    public void setSaleChannelPos(boolean saleChannelPos) {
        this.saleChannelPos = saleChannelPos;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Object beginTime) {
        this.beginTime = beginTime;
    }

    public Object getEndTime() {
        return endTime;
    }

    public void setEndTime(Object endTime) {
        this.endTime = endTime;
    }

    public boolean isGroup(){
//        if (needBind)

        //true,绑定,多组
            return needBind;
//        return "2".equals(priceGroupType);
    }

    public boolean isCategoryLevelOne(){
        return "1".equals(storeCategoryType);
    }

    @Override
    public String toString() {
        return JsonUtils.toJson(this);
    }
}
